package com.coffee.tenant;

import com.coffee.core.CoffeeHeader;

import javax.servlet.http.HttpServletRequest;

/**
 * @author songkui
 * @since 2024/4/17 13:44
 */
public interface CoffeeWebTenantDecider {

    default void decide(HttpServletRequest request){
        Long tenantId =  CoffeeHeader.getTenant(request);
        if (tenantId != null) {
            TenantContextHolder.setTenantId(tenantId);
        }
    }
}
